package com.yps.io.aio.server;

/**
 * @author yps
 * AIO服务端
 */
public class Server {

	private static int DEFAULT_PORT = 12345;
	private static AsyncServerHandler  serverChannel;
	public volatile static long clientCount =0;//计算请求数
	//默认启动方法
	public static void start(){
		start(DEFAULT_PORT);
	}
	public static synchronized void start(int port){
		if(serverChannel != null){
			return ;
		}
		serverChannel = new AsyncServerHandler(port);
		new Thread(serverChannel, "Server").start();;
	}
	public static void main(String[] args) {
		start();
	}
}
